﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BFlatCompile.Nodes
{
	public class ThisValue : Expression
	{
		public Token Token { get; private set; }

		public ThisValue(Token token)
		{
			this.Token = token;
		}

		public override void ResolveCode(Class c, Dictionary<object, object> parents)
		{
			// nothing to resolve
		}

		public override void ResolveClassToThis(Class c)
		{
			// This method will be called on all code in static functions.
			// To convert the local class name to "this".
			// If there already is a "this" in the function, then that's bad.
			throw new Exception("Cannot use \"this\" in static context.");
		}
	}
}
